package com.cq.hd.product.api;

import com.cq.hd.common.entity.mq.ActiveBrowseMsg;
import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.product.api.dto.ActiveBrowseDto;
import com.cq.hd.product.api.dto.ActiveBrowsePageDto;
import com.cq.hd.product.api.vo.ActiveBrowsePageVo;
import com.cq.hd.product.api.vo.ActiveBrowseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "hd-o2o-product-service", contextId = "active-browse-api")
public interface TbActiveBrowseApi {

    // 活动浏览列表
    @GetMapping("/product/activeBrowse/page")
    Result<Page<ActiveBrowsePageVo>> page(@SpringQueryMap ActiveBrowsePageDto activeBrowsePageDto);

    // 清空浏览记录
    @PostMapping("/product/activeBrowse/clear")
    Result<Boolean> clear(@RequestParam("userId") Long userId);

    // 清空近2个月浏览记录
    @PostMapping("/product/activeBrowse/removeActiveBrowseJob")
    Result<Boolean> removeActiveBrowseJob();

    // 根据条件获取浏览列表
    @GetMapping("/product/activeBrowse/listByDto")
    Result<List<ActiveBrowseVo>> listByDto(@SpringQueryMap ActiveBrowseDto activeBrowseDto);

    // 消费活动浏览消息
    @PostMapping("/product/activeBrowse/consumerActiveBrowseMsg")
    Result<Boolean> consumerActiveBrowseMsg(@RequestBody ActiveBrowseMsg activeBrowseMsg);
}
